package cn.getech.data.development.constant;

import lombok.Getter;

/**
 * 任务状态的枚举
 *
 * @author zenith
 */
@Getter
public enum JobStatus {

    DEACTIVE(false, "禁用"),
    ACTIVE(true, "启用");

    Boolean code;
    String name;

    JobStatus(Boolean code, String message) {
        this.code = code;
        this.name = message;
    }

    public static JobStatus ObjOf(Boolean code) {
        if (code == null) {
            code=false;
        }
        for (JobStatus s : JobStatus.values()) {
            if (s.getCode() == code) {
                return s;
            }
        }
        return null;
    }
}
